package com.xwh.week3;

public class Practice10 {
    public static void main(String[] args) {
        int ans=0;
        for(int i=2;i<295345;i++){
            ans+=method(i);
        }
        System.out.println(ans);
    }
    public static int method(int n){
        int temp=n;
        int ans=0;
        while(temp>0){
            ans+=method1(temp%10);//ans%10
            temp/=10;
        }
        if(ans==n){
            return ans;
        }
        return 0;
    }
    public static int method1(int n){
        int ans=1;
        for(int i=0;i<5;i++){
            ans*=n;
        }
        return ans;
    }
}
